from sklearn.cross_validation import cross_val_score
from sklearn.ensemble import AdaBoostClassifier
from sklearn.datasets import load_svmlight_file
import sys
ab = AdaBoostClassifier(n_estimators=500)
X_train, y_train = load_svmlight_file(sys.argv[1])
X_test, y_test = load_svmlight_file(sys.argv[2])
X_dense=X_train.toarray()
X_test_dense = X_test.toarray()
ab.fit(X_dense,y_train)
#print ab.score(X_test_dense, y_test)
 
from sklearn.ensemble import BaggingClassifier 
from sklearn import svm
from sklearn.datasets import load_svmlight_file
import sys

bagging_svm = BaggingClassifier(svm.SVC(kernel = 'rbf', C=0.0001, gamma=0.0078),
				max_samples=0.5, max_features=1)
bagging_svm.fit(X_dense,y_train)
#print bagging_svm.score(X_test_dense, y_test)
 
from sklearn import tree
from sklearn.cross_validation import cross_val_score
from sklearn.ensemble import ExtraTreesClassifier 
from sklearn.datasets import load_svmlight_file
import sys
et = ExtraTreesClassifier(n_estimators=20, max_depth=None, min_samples_split=1)
#clf.set_params(warm_start=True)
#X_dense=X_train.toarray()
#X_test_dense = X_test.toarray()
et.fit(X_dense,y_train)
#print et.score(X_test_dense, y_test)
#scores=cross_val_score(clf,X_dense,y_train) 
#print scores.mean()
from sklearn.cross_validation import cross_val_score
from sklearn.ensemble import RandomForestClassifier 
from sklearn.datasets import load_svmlight_file
import sys
rf = RandomForestClassifier(n_estimators=20, max_depth=None, min_samples_split=1)
#clf.set_params(warm_start=True)
#X_dense=X_train.toarray()
#X_test_dense = X_test.toarray()
rf.fit(X_dense,y_train)
#print rf.score(X_test_dense, y_test)

if (ab.predict(X_test_dense) + bagging_svm.predict(X_test_dense) +
        et.predict(X_test_dense) + rf.predict(X_test_dense) >= 0):
    print sys.argv[1]


